/**
 * @file HelpConfigManager.hpp
 *
 * @author Alejandro Dario Simi
 * @url http://www.daemonraco.com
 * @date 2011-12-03
 */

#ifndef __HELPCONFIGMANAGER_HPP__
#define __HELPCONFIGMANAGER_HPP__

#include <string>
#include <vector>
#include <map>
using namespace std;

#include <defines.h>

class HelpConfigManager {
	public:
		typedef struct {
				bool isChild;
				bool hasChildren;
				string name;
				string url;
				string parent;
		} ItemInfo;
		typedef map<string, ItemInfo> ItemInfoMap;

	protected:
		string		_config;
		bool		_isLoaded;
		ItemInfoMap	_items;
		string		_icon;
		string		_init;
		string		_title;

	public:
		HelpConfigManager(string config);
		virtual ~HelpConfigManager();

	public:
		virtual string config() const;
		virtual string icon() const;
		virtual string init() const;
		virtual const ItemInfoMap &items() const;
		virtual string title() const;

	protected:
		virtual bool addItem(const vector<string> &conf);
		virtual int expandConfigLine(const string line, vector<string> &lines) const;
		virtual bool isLoaded() const;
		virtual bool load();
		virtual bool loadConfigLine(const vector<string> &conf);
		virtual string noCommentsConfigLine(const string line) const;
		virtual bool set(const vector<string> &conf);
		virtual bool setIcon(const vector<string> &conf);
		virtual bool setInit(const vector<string> &conf);
		virtual bool setTitle(const vector<string> &conf);
};

#endif /* __HELPCONFIGMANAGER_HPP__ */
